home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / winlib.lzh / WLCOOKIE / COOKCHK.C next >
Encoding:
C/C++ Source or Header  |  1994-04-04  |  1.6 KB  |  52 lines

  1. /*
  2.  *    Check to make sure cookie is securely installed
  3.  *    by Ken Hollis
  4.  *
  5.  *    Copyright (C) 1994, Bitgate Software, all rights reserved.
  6.  */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <screen.h>
  11. #include "winlib.h"
  12.  
  13. GLOBAL main()
  14. {
  15.     long *cook;
  16.     COOKIE *cookie;
  17.     PROGCOOKIE *pcook;
  18.  
  19.     Cur_off();
  20.     Rev_on();
  21.  
  22.     printf("\n\n       WinLIB PRO Cookie Checker      \n");
  23.     printf("  COPYRIGHT \275 1994, Bitgate Software  \n");
  24.     printf(" Compiled on "__DATE__" at "__TIME__"  \n\n");
  25.  
  26.     get_cookie('WPRO', cook);
  27.     cookie = (COOKIE *) 0x6DD02;
  28.  
  29.     if (cookie == NULL) {
  30.         Rev_off();
  31.         printf("Cookie not installed.\n");
  32.         exit(1);
  33.     }
  34.  
  35.     pcook = (PROGCOOKIE *) cookie->cookie_value;
  36.  
  37.     Rev_off();
  38.  
  39.     printf("%s\n",(pcook->magic == 0xBEEF) ? "Installation magic matched" : "Cannot locate WPRO magic!");
  40.     printf("%ld\n",pcook->magic);
  41. /*    printf("%s\n",(pcook->draw3d.magic == 0xBEEF) ? "Draw3D magic matched" : "No Draw3D magic");
  42.     printf("%s\n",(pcook->textmagic == 0xBEEF) ? "TEXT magic matched" : "No TEXT magic");
  43.     printf("%s\n",(pcook->custmenu.magic == 0xBEEF) ? "Custom menu magic matched" : "No custom menu magic");
  44.     printf("%s\n",(pcook->deskrouts.magic == 0xBEEF) ? "Desktop rouines magic matched" : "No desktop routines magic");
  45.     printf("%s\n",(pcook->xaes_vdimagic == 0xBEEF) ? "XAES/XVDI magic matched" : "No XAES/XVDI magic");
  46.     printf("%s\n",(pcook->resource.magic == 0xBEEF) ? "Resource file magic matched" : "No resource file magic");
  47.     printf("%s\n",(pcook->clipbrd_magic == 0xBEEF) ? "Clipboard magic matched" : "No clipboard magic"); */
  48.  
  49.     remove_cookie('WPRO');
  50.  
  51.     exit(0);
  52. }